package com.linkhub.oms.admin.common.enums;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.google.common.collect.Lists;
import com.linkhub.oms.common.enums.IEnumConvert;
import com.linkhub.oms.common.enums.mp.CustomerBusinessStatusEnum;
import com.linkhub.oms.common.enums.mp.CustomerOrderStatusEnum;
import com.linkhub.oms.entity.OrderEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

import static com.linkhub.oms.admin.modules.order.constant.OrderConstant.ORDER_LIST_STATUS;

/**
 * @Description: CustomerMenuMappingStateEnum
 * @Author: echo
 * @Date: 2024/4/9 10:31
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
public enum CustomerMenuMappingStateEnum implements IEnumConvert<Integer> {
    ORDER_LIST(1, "订单列表", ORDER_LIST_STATUS, OrderEntity::getCustomerBusinessStatus),

    IN_PERFORMANCE(2, "履约中",
            Lists.newArrayList(CustomerOrderStatusEnum.IN_STOCK, CustomerOrderStatusEnum.OUT_OF_STOCK),
            OrderEntity::getCustomerOrderStatus),

    TRACKING(3, "追踪订单", Lists.newArrayList(CustomerBusinessStatusEnum.TRACKING), OrderEntity::getCustomerBusinessStatus),
    ABNORMAL(4, "异常订单", Lists.newArrayList(CustomerBusinessStatusEnum.ABNORMAL), OrderEntity::getCustomerBusinessStatus),

    ;
    private final Integer code;
    private final String desc;
    private final List<?> bizStatus;
    private final SFunction<OrderEntity, ?> column;

}
